package src.main.observer.jdk;

/**
 * @author liayun
 * @create 2021-09-29 19:55
 */
public class Client {
    public static void main(String[] args) {
        // 创建小偷对象
        Thief thief = new Thief("隔壁老王");
        // 创建警察对象
        Policemen policemen = new Policemen("老李");
        // 让警察盯着小偷
        thief.addObserver(policemen);
        // 小偷偷东西
        thief.steal();
    }
}
